package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ArticleCommentsMapper;
import com.ruoyi.system.domain.ArticleComments;
import com.ruoyi.system.service.IArticleCommentsService;

/**
 * 文章评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-15
 */
@Service
public class ArticleCommentsServiceImpl implements IArticleCommentsService 
{
    @Autowired
    private ArticleCommentsMapper articleCommentsMapper;

    /**
     * 查询文章评论
     * 
     * @param articleCommentId 文章评论主键
     * @return 文章评论
     */
    @Override
    public ArticleComments selectArticleCommentsByArticleCommentId(Long articleCommentId)
    {
        return articleCommentsMapper.selectArticleCommentsByArticleCommentId(articleCommentId);
    }

    /**
     * 查询文章评论列表
     * 
     * @param articleComments 文章评论
     * @return 文章评论
     */
    @Override
    public List<ArticleComments> selectArticleCommentsList(ArticleComments articleComments)
    {
        return articleCommentsMapper.selectArticleCommentsList(articleComments);
    }

    /**
     * 新增文章评论
     * 
     * @param articleComments 文章评论
     * @return 结果
     */
    @Override
    public int insertArticleComments(ArticleComments articleComments)
    {
        articleComments.setCreateTime(DateUtils.getNowDate());
        return articleCommentsMapper.insertArticleComments(articleComments);
    }

    /**
     * 修改文章评论
     * 
     * @param articleComments 文章评论
     * @return 结果
     */
    @Override
    public int updateArticleComments(ArticleComments articleComments)
    {
        articleComments.setUpdateTime(DateUtils.getNowDate());
        return articleCommentsMapper.updateArticleComments(articleComments);
    }

    /**
     * 批量删除文章评论
     * 
     * @param articleCommentIds 需要删除的文章评论主键
     * @return 结果
     */
    @Override
    public int deleteArticleCommentsByArticleCommentIds(Long[] articleCommentIds)
    {
        return articleCommentsMapper.deleteArticleCommentsByArticleCommentIds(articleCommentIds);
    }

    /**
     * 删除文章评论信息
     * 
     * @param articleCommentId 文章评论主键
     * @return 结果
     */
    @Override
    public int deleteArticleCommentsByArticleCommentId(Long articleCommentId)
    {
        return articleCommentsMapper.deleteArticleCommentsByArticleCommentId(articleCommentId);
    }
}
